﻿// NET 5（包括 .NET Core）或更高版本：没有输出，因为在应用程序终止时，此 .NET 的实现不调用终结器。
Third? t = new();
t = null;

class First
{
    ~First()  // finalizer
    {
        // System.Console.WriteLine("First's Finalizer is called. 00");
        System.Diagnostics.Trace.WriteLine("First's Finalizer is called.");
    }
}

class Second : First
{
    ~Second()
    {
        // System.Console.WriteLine("Second's Finalizer is called.  00");
        System.Diagnostics.Trace.WriteLine("Second's Finalizer is called.");
    }
}

class Third : Second
{
    ~Third()
    {
        // System.Console.WriteLine("Third's Finalizer is called.  00");
        System.Diagnostics.Trace.WriteLine("Third's Finalizer is called.");
    }
}
